#!/usr/bin/env python
'''
	4.2) Ask the user to type something (use raw_input). To find out
	whether the input was a number, compare whether the input is 
	after "0" and before ":" in alphabetical order. If it is a 
	number convert it into an integer. Then print the input and its 
	type. (Note: this won't work if the user enters a real number. 
	See below.) Note: the order of the alphabet in Unix and Python is
	: symbols, numbers, upper case letters, lower case letters.) 
'''
# http://web.cs.mun.ca/~michael/c/ascii-table.html
# control chars = 0 -> 31
# symbols (space) 32 -> (/) 47
# 0-9 -> ascii 48 -> 57
# symbols (:) 58 -> (@) 64 
# uppercase (A) 65 -> (Z) 90
# symbols ([) 91 -> (`) 96
# lowercase (a) 97 -> (z) 122
# symbols ({) 123 -> (~) 126
# control (del ) 127

# via import.string
'''
>>> import string
>>> string.uppercase 
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> string.digits
'0123456789'
>>> string.printable
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'
>>> string.lowercase
'abcdefghijklmnopqrstuvwxyz'
'''

something = input("geef me iets (één teken aub): ")
something_type = type(something)
if (something >= "0" and something < ":"):
	print(something, " is a number")
	something = int(something)
else:
	print(something, something_type)
